package com.tanhua.server;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration;
import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
import org.springframework.context.annotation.Bean;

/**
 * @author : xyiaao
 * @createDate : 2022/3/14 9:33
 */
//启动类
@SpringBootApplication(exclude = {
        MongoAutoConfiguration.class,
        MongoDataAutoConfiguration.class
})
// @Import(TokenInterceptor.class)
public class AppServerApplication {

    public static void main(String[] args) {

        SpringApplication.run(AppServerApplication.class, args);
    }


    @Bean
    public Redisson redisson() {

        Config config = new Config();
        config.useSingleServer().setAddress("redis://192.168.136.160:6379");
        RedissonClient redisson = Redisson.create(config);
        return (Redisson) redisson;
    }

}
